import pandas as pd
import numpy as np

df = pd.DataFrame(np.array([[1,2,3],[4,5,6]]),columns=['Column1','Column2','Column3'])
df1 = pd.DataFrame(np.array([[1,2,3],[4,5,6]]),columns=['Column1','Column2','Column3'])
df2 = pd.DataFrame(np.array([[1,2,3],[4,5,6]]),columns=['Column1','Column2','Column3'])
print(df)

# 1、合并

# 纵向合并
print(pd.concat([df1, df2], ignore_index=True))

# 横向合并
print(pd.merge(df1, df2, on='Column1'))

# 2、分割

# 长格式转宽格式
df_pivot = df.pivot(index='Column1', columns='Column2', values='Column3')
print(df_pivot)

# 宽格式转长格式
df_melt = df.melt(id_vars='Column1', value_vars=['Column2', 'Column3'])
print(df_melt)